34. application analog write and read
你好。
Hello.
在这个故事中,我们就来看看,里面的程序是什么?
In this story, we will take a look, what's the program inside?
该区域是输入模块配置,该区域是模拟输出模块配置。
This area is an input module configuration, and this area is analog output module configuration.
我会像那样展示它。
I will show it to like that.
好的。
OK.
首先,就像在第一个模块模拟输入模块的示例中一样,我们正在读取控制寄存器 30。
Firstly, like in the example from the first module analog input module we are reading to control register 30.
我们只读取一个数据并将其写入 D4 并进行比较。
And just one data we are reading and we are writing it to D4 and we are comparing it.
你可以问我,我们需要这个吗?
You can ask me, Do we need this?
不,绝对是。
No, absolutely.
不。
No.
我要这个。
I will take this one.
好的。
OK.
这转换了程序,我们正在写入第一个模块。
And this convert the program and we are writing to first module.
这是我的模拟输入模块。
This is my analog input module.
我们正在写入十六进制零和第一个控制器寄存器。
We are writing hexadecimal zero and the first controller registers.
所以这就是完整的。
So this is whole.
通道现在为负 10 到正 10 伏。
Channels are now minus 10 to plus 10 volts.
这是电压输入选择,我们只是写入一个数据。
So this is the voltage input selection and we are just writing one data.
据此,我们正在向控制寄存器一写入两个数据。
And according to that, we are writing to control register one for two data.
那么我们真的需要这个吗?
So do we need this, actually?
我们不需要这个。
We don't need this.
我们也可以延迟这个并控制寄存器 29。
We can delay this also and also control register 29.
我们正在将其读入 D 100。
We are reading it into the D 100.
我将删除这一行左右。
I will delete this line or so.
而且,按照这条线,我会把这件事推迟。
And also, according to this line, I will delay this one.
好的,就在这里。
OK, just here.
我将使用这里的指令,并将我的行放在这里。
I will use this from instruction into here, and I will put my line like that here.
我将插入这些。
I will insert these one.
并且同样在编程区域,我们可以满足这些和其他控制寄存器的监控。
And also in the programming area, we can meet these and other control registers to monitor.
是在错误中,我的模块还是什么异常的东西或者什么分数?
Is it in the error, my module or what is the abnormal things or what score?
出了什么问题?
What goes wrong?
或者也许您需要使用偏移或增益设置,但现在我将向您展示。
Or maybe you need to use, offset or gain settings, but now I will just show to you.
我们如何读取输入以及如何正确?
How can we read on a input and how can be right?
这只是一个工具。
This is just a tool.
好的,我们刚刚对第一个模块模拟输入模块进行了正确的设置,并将电压输入写入零。
OK, we just did a settings correctly to first module analog input module and we write to zero to voltage input.
做好准备。
Be prepared.
然后我们总是从模拟输入模块控制寄存器 5 读取数据,并将其写入模拟输出模块 124 中。
And then we are reading always from the Analog Input Module Control Register five and we are writing it into the one hundred and twenty four the analog output module.
我也将删除它,好的,我们正在编写以解锁所有输出模块。
I will just delete this too, OK, and just we are writing to unlock all output module.
我是说所有通道都是电压输出模式,负10到正10伏,我们将其写入控制寄存器零。
I am saying that all channels are voltage output mode and minus 10 to plus 10 volt, and we are writing it to control registers zero.
这是设置控制器寄存器,从通道一右侧到输出。
This is the setting controller register and the from the Channel one right to your output.
只需要我们在这里使用的通道一减去 10 伏即可。
Just want Channel one we are using here minus the 10 volt.
我们正在骑它。
We are riding it.
我们是D500,好吗?
We are D500, OK?
让我们转换这个项目。
And let's convert this project.
好的,这是我的模拟输入设置。
OK, this is my analog input settings.
您会很容易地看到这是我的模拟输出设置。
You will see this is my analog output settings just easily.
我将转换它并且它已转换。
I will convert it and it's converted.
然后我们将其发送到 LC 和 main 并执行。
And then let's send it to the LC and the main and execute.
我会的。
And I will.
我现在写信给你。
I'm writing to you now.
我会说,是的,我们现在需要再等一下。
I will say, yes, we need to wait a little bit more now.
好的,我们继续。
OK, let's continue.
我会说是的。
I will say yes.
完成了,我会关闭它,我会去监控。
And it's completed, and I will close it, and I will go to monitoring.
好的。
OK.
之前的测试也正好到这里。
And previous tests are just right to here.
我先权利听到500里模拟量输出模块的数据寄存器区如果我在这里一千。
I will first the right to hear the 500 mile analog output module data register area if I right here one thousand.
并将其写入 write 并输出五倍。
And it will be written into written to output five fold.
好的。
OK.
这是五倍,因为从 PDA 文件中记得,它在 0 到 2000 之间。
This is a five fold because remember from the PDA file, it was between zero to 2000.
零到 2000 等于等于。
Zero to 2000 was equal equals to.
最后两个面板上组,看到1000就五折了,然后我们再看一下,运行是否正确?
The last two panel took on the group, saw 1000 will be five fold, and then let's take a look once, is it correctly running or not?
我有最后通牒。
I have an ultimatum.
我正在准备一个区域。
And I am preparing an area.
好的,现在我将它展示给你。
OK, now I will show it to you.
我现在正在测量之间。
I am measuring now between.
加电压。
Plus voltage.
再给你说清楚一点。
Make it clear for you a little bit more.
它出什么问题了?
What's wrong with it?
好的。
OK.
现在你会看到我正在测量正电压和负电压,这条电缆连接到这里,你会在仪表上看到是五倍,好吗?
Now you will see I am measuring plus voltage and also minus voltage, this cable is connected to here and you will see on the meter is five fold, OK?
这是我的模拟输出侧给出了五倍并进入左侧,我们有模拟输入模块,然后我现在在这里测量它也即将到来的五倍,但现在我将只更改键的值五百。
And this is my analog output side is giving a five fold and into the left side, we have the analog input module and then I'm measuring it now here also five fold this coming, but now I will just change the value of the key five hundred.
现在重点听一下,你120正在读取这1000个电压输出还是五倍?
And now focus to hear, do you 120 is reading these 1000 voltage outputs or fivefold?
读数为一千六百二十八。
It is reading one thousand six hundred twenty eight.
如果我更改模拟输出值,例如五百,好的,它会显示现在是八百。
If I change my analog output value, for example, five hundred, OK, it will read it is now eight hundred.
好吧,那我们就看一次吧。
OK, so let's just take a look once.
根据我的数据,它提供的 2.5 伏电压正确吗?
Is it correctly giving 2.5 volt, according to my data?
我正在测量它,然后我会把它展示给你。
And I am measuring it, and I will show it to you.
让我。
Let me.
打开它。
Open it.
好的,现在我们就看到它了。
OK, now we will see it now.
你会看到两个电压。
You will see two voltage.
测量它和 2.5 和 3,好的,这是正确的。
And measuring it and 2.5 and three, OK, this is correct.
如果我在这里给。
And if I give here.
我的输出是两千。
Two thousand to my output.
这是我的模拟输出数据,您现在将看到 10 伏来自通道一的模拟输出模块。
This is my analog output data, and you will see now 10 volt is from the analogue output module for the Channel one.
还有这个问题。
And this gotcha here.
现在你可以看到了。
And now you can see.
我在 B+ 和 -B 之间测量它。
I'm measuring it between B-plus and the minus.
我的高度计正在向我显示 10 个世界,好吗?
And my altimeter is showing to me 10 world, OK?
这里是直接连接的。
And here is connected directly.
然后我们也从第一个模块开始阅读,重点是这里的另一个重要点。
And then also we are reading from the first module and the focus to here just another important point.
这是K零零,这是K1和K1,所以我们在KLC第一个型号之后是零。
This is K zero zero, this is K1 and K1, so what we have after the KLC first model number is zero.
我不看,我就把型号写为一。
And I don't look, I'll put model number is one.
好吧,别忘了这一点。
OK, don't forget this.
例如,如果我在这里写入任何数据,它就会给出输出。
If I write here, for example, any data, it will give an output, for example.
这是正确的。
That's right.
零到2000之间的一、二、三、四,我来设置。
One, two, three and four between zero to 2000, I will set it.
好的,我们再测量一下。
OK, so let's measure it again.
这是六倍,好吧,你会看到我正在测量它,六倍,十二倍,所以一切正常。
And this is a six fold, OK, you will see I'm measuring it and six, 12, so everything is working.
例如,如果我们使用的是 0 到 50 赫兹,我们可以缩放该输出,并且该输出可以在 0 到 10 伏之间运行我的 VFD,这将等于 0 到 50 赫兹或安装或安装到设备中的任何东西。 50.
If we are working with the, for example, zero to 50 has, we can scale this output and this output can run my VFD between zero to 10 volt and this will be equal to zero to 50 hertz or whatever is installed or settled into the 50.
但对于本教程,我已经完成了。
But for this tutorial, I'm finished here.
这基本上是一个简单的模拟输入和输出模块使用示例。
This is really basically an easily analog input and output module usage example.
我们如何使用它?
How can we use it?
我们可以这样使用它。
We can use it like that.
这真的很容易。
It is really easy.
这确实是一种基本的编程技术。
It is really a basic programming technique.
好的,本教程到这里就结束了。
OK, for this tutorial, I finished here.
看完这个教程你可以问我。
You can ask me after this tutorial.
最后一件事,好吧,我们正在写一二三四,我们正在读两千。
Just last thing, OK, we are writing one two three four and we are reading from the two thousand.
它取决于事物的抵消和对抗。
It is up to offset and against the things.
我们可以做到这一点。
We can do it.
但这就是我想向您展示的。
But this is what I want to show you.
我们如何写作以及如何阅读。
How we can write and how we can read.
最多有两个模块设置,但这并不重要。
It is up to two module settings, but it doesn't matter.
相信我,但如果您需要额外的支持,您可以问我一个问题,我们会为此制作一个额外的视频教程。
Believe me, but if you need an extra support about it, you can ask me a question and we will do an extra, uh, video tutorials for it.
本教程到这里就结束了。
For this tutorial, I'm finished here.
明年见。
See you into next year.